package events;
import traveler.Car;

/**
 * Car_Arrival is a type of {@link Event} that represents a {@link Car} arriving
 * at a Neighborhood. This class inheirts the basic properties of the
 * Event Class while adding additional values representing the necessary
 * characteristics of a car arriving at its destination.
 * 
 * @author Team Switchboard Boxcar
 * 
 */
public class Car_Arrival extends Event {

	private Car Car; 
	private int Destination;
	private int OriginRoadID;
	private int OriginNeighborhoodID;

	/**
	 * The Car_Arrival Constructor builds the Car_Arrival event. This
	 * constructor defines the Car that is arriving, the neighborhood it is
	 * traveling from and to, the road it is traveling on and the time that the
	 * car arrives.
	 * 
	 * @param MyCar
	 *            The Car Scheduled to arrive at a Neighborhood.
	 * @param MyDestination
	 *            The index (0-3) of the neighborhood at which the car will
	 *            arrive.
	 * @param MyRoad
	 *            The road index the car is taking to arrive at its destination.
	 *            This is the road index from the starting neighborhood not at
	 *            its destination.
	 * @param MyTime
	 *            The time in minutes since the simulation has started that the
	 *            car is scheduled to arrive at its destination.
	 * @param MyNeighborhood
	 *            The index (0-3) of the neighborhood the car departed from.
	 */
	public Car_Arrival(	Car MyCar, int MyDestination, 
						int MyNeighborhood, int MyRoad, int MyTime) 
	{
		super(2, MyTime);
		Car = MyCar;
		Destination = MyDestination;
		OriginRoadID = MyRoad;
		OriginNeighborhoodID = MyNeighborhood;
	}

	/**
	 * GetCar returns the Car that is traveling between two
	 * Neighborhoods in a Car_Arrival Event.
	 * 
	 * @return Returns the Car that is being processed by this event.
	 * @see Car
	 */
	public Car GetCar() 
	{	return Car; }

	/**
	 * GetDestination returns the destination Neighborhood index for a
	 * Car_Arrival Event.
	 * 
	 * @return An integer representing the destination neighborhood index.
	 */
	public int GetDestination() 
	{	return Destination;	}

	/**
	 * GetOriginRoad returns the Road index representing the road taken
	 * from the Origin Neighborhood.
	 * 
	 * @return An integer representing the origin road index.
	 */
	public int GetOriginRoad() 
	{	return OriginRoadID; }
	

	/**
	 * GetOriginNeighborhood is a function that can be called to return the
	 * Neighborhood index representing the origin neighborhood for a
	 * Car_Arrival Event.
	 * 
	 * @return An integer representing the origin neighborhood index.
	 */
	public int GetOriginNeighborhood() 
	{	return OriginNeighborhoodID; }

}